package com.billdowney.controller.user;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.billdowney.annotation.AuthRoleAllowed;
import com.billdowney.controller.BaseController;
import com.billdowney.entity.user.UserInfo;
import com.billdowney.service.interfaces.user.UserInfoService;
import com.billdowney.util.return_type.ReturnData;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 用户控制器
 * 
 * @author 超级小富翁 - BillDowney
 * @data 2017年8月27日 下午7:41:12
 */
@RestController
@RequestMapping(value = "/user", method = { RequestMethod.POST })
@Api(tags = "用户控制器")
public class UserController extends BaseController {

	@Autowired
	private UserInfoService userInfoService;

	@AuthRoleAllowed
	@RequestMapping(value = "/getUserInfo")
	@ApiOperation(value = "获取登录的用户信息", response = UserInfo.class)
	public ReturnData getUserInfo() throws Exception {
		return new ReturnData(getUserLoginInfo().getUserInfo());
	}

}
